<?php
/**
 * Top menu for Xenea theme
 *
 * Genmod: Genealogy Viewer
 * Copyright (C) 2002 to 2003 John Finlay and Others
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * @package Genmod
 * @subpackage Themes
 * @version $Id: toplinks.html 10 2013-12-30 20:15:01Z boudewijn.sjouke@gmail.com $
 */

if ($TEXT_DIRECTION=="rtl") $ff="_rtl";
else $ff="";

?>
<table width="100%" border="0" cellspacing="0" cellpadding="4" bgcolor="#FFFFFF" style="border: 1px solid #84beff">
	<tr>
		<td>
			<div align="center">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
					<tr>
						<td width="10">&nbsp;</td>
						<td width="10%" valign="top">
							<div align="center"><a href="<?php print $HOME_SITE_URL; ?>"><img class="icon" src="<?php print $GM_IMAGE_DIR; ?>/home.gif" alt="<?php print $HOME_SITE_TEXT; ?>" /><br /><font class="barra"><?php print $HOME_SITE_TEXT; ?></font></a></div>
						</td>
						<td width="10%" valign="top">
   				            <?php
 			                //-- gedcom welcome menu
 			                $my_temp_menu=get_gedcom_menu();
 			                $i=0;
			                 if (isset($my_temp_menu["items"]))
								foreach ( $my_temp_menu["items"] as $key ) {
									$my_temp_menu["items"][$i]["class"] = "submenuitem$ff";
									$my_temp_menu["items"][$i]["hoverclass"] = "submenuitem_hover$ff";
 			                  $i++;
 		  	                }
			                print_menu($my_temp_menu);
 			                ?>
						</td>
						<td width="10%" valign="top">
							<?php
							//-- mygedview menu
							$menu = array();
							$menu["label"] = $gm_lang["mygedview"];
							$menu["labelpos"] = "down";
							$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["mygedview"]["large"];
							$menu["link"] = "index.php?command=user";
							$menu["class"] = "menuitem";
							$menu["hoverclass"] = "menuitem_hover";
							$menu["flyout"] = "down";
							$menu["submenuclass"] = "submenu";
							$menu["items"] = get_mygedview_submenu();

							$i=0;
							if (isset($menu["items"]))
							foreach ( $menu["items"] as $key ) {
						 	    $menu["items"][$i]["class"] = "submenuitem$ff";
						 	    $menu["items"][$i]["hoverclass"] = "submenuitem_hover$ff";
						 		$i++;
							}

							print_menu($menu);
							?>
						</td>
						<td width="10%" valign="top">
							<?php
							//-- charts menu
							$menu = array();
							$menu["label"] = $gm_lang["charts"];
							$menu["labelpos"] = "down";
							$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["pedigree"]["large"];
							if (file_exists("pedigree.php")) $menu["link"] = "pedigree.php";
							$menu["class"] = "menuitem";
							$menu["hoverclass"] = "menuitem_hover";
							$menu["flyout"] = "down";
							$menu["submenuclass"] = "submenu";
							$menu["items"] = array();

							if (file_exists("pedigree.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["pedigree_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["pedigree"]["small"];
								$submenu["link"] = "pedigree.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("descendancy.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["descend_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["descendant"]["small"];
								$submenu["link"] = "descendancy.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("timeline.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["timeline_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["timeline"]["small"];
								$submenu["link"] = "timeline.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("relationship.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["relationship_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["relationship"]["small"];
								$submenu["link"] = "relationship.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("ancestry.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["ancestry_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["ancestry"]["small"];
								$submenu["link"] = "ancestry.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("fanchart.php") and function_exists("imagettftext")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["fan_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["fanchart"]["small"];
								$submenu["link"] = "fanchart.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("hourglass.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["hourglass_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["hourglass"]["small"];
								$submenu["link"] = "hourglass.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}
							if (file_exists("familybook.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["familybook_chart"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["fambook"]["small"];
								$submenu["link"] = "familybook.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							print_menu($menu);
							?>
						</td>
						<td width="10%" valign="top">
							<?php
							//-- lists menu
							$menu = array();
							$menu["label"] = $gm_lang["lists"];
							$menu["labelpos"] = "down";
							$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["indis"]["large"];
							if (file_exists("indilist.php")) $menu["link"] = "indilist.php";
							$menu["class"] = "menuitem";
							$menu["hoverclass"] = "menuitem_hover";
							$menu["flyout"] = "down";
							$menu["submenuclass"] = "submenu";
							$menu["items"] = array();

							if (file_exists("indilist.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["individual_list"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["indis"]["small"];
								$submenu["link"] = "indilist.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("famlist.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["family_list"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["cfamily"]["small"];
								$submenu["link"] = "famlist.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							//-- produce a plot of statistics
			                if (file_exists("statistics.php")&&file_exists("jpgraph")) {
				                $submenu = array();
				                $submenu["label"] = $gm_lang["statistics"];
				                $submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["statistic"]["small"];;
				                $submenu["link"] = "statistics.php";
				                $submenu["class"] = "submenuitem$ff";
				                $submenu["hoverclass"] = "submenuitem_hover";
				                $menu["items"][] = $submenu;
			                }

			                //-- list most ancient parent of a family
			                if (file_exists("patriarchlist.php")) {
				                $submenu = array();
				                $submenu["label"] = $gm_lang["patriarch_list"];
				                $submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["patriarch"]["small"];;
				                $submenu["link"] = "patriarchlist.php";
				                $submenu["class"] = "submenuitem$ff";
				                $submenu["hoverclass"] = "submenuitem_hover";
				                $menu["items"][] = $submenu;
			                }

			                if ($SHOW_SOURCES>=getUserAccessLevel(getUserName())) {
				                if (file_exists("sourcelist.php")) {
									$submenu = array();
									$submenu["label"] = $gm_lang["source_list"];
									$submenu["labelpos"] = "right";
									$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["source"]["small"];
									$submenu["link"] = "sourcelist.php";
									$submenu["class"] = "submenuitem$ff";
									$submenu["hoverclass"] = "submenuitem_hover$ff";
									$menu["items"][] = $submenu;
								}

								if (file_exists("repolist.php")) {
					                $submenu = array();
								    $submenu["label"] = $gm_lang["repo_list"];
					                $submenu["labelpos"] = "right";
									$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["repository"]["small"];
							        $submenu["link"] = "repolist.php";
							        $submenu["class"] = "submenuitem$ff";
								    $submenu["hoverclass"] = "submenuitem_hover$ff";
									$menu["items"][] = $submenu;
								}
							}

							if (file_exists("placelist.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["place_list"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["place"]["small"];
								$submenu["link"] = "placelist.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("aliveinyear.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["alive_in_year"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["indis"]["small"];
								$submenu["link"] = "aliveinyear.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}

							if (file_exists("medialist.php")) {
								global $MULTI_MEDIA;
								if( $MULTI_MEDIA ) {
									$submenu = array();
									$submenu["label"] = $gm_lang["media_list"];
									$submenu["labelpos"] = "right";
									$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["media"]["small"];
									$submenu["link"] = "medialist.php";
									$submenu["class"] = "submenuitem$ff";
									$submenu["hoverclass"] = "submenuitem_hover$ff";
									$menu["items"][] = $submenu;
								}
							}

							print_menu($menu);
							?>
						</td>
						<?php
						if (file_exists("calendar.php")) {
							print "<td width=\"10%\" valign=\"top\">";
							$menu = array();
							$menu["label"] = $gm_lang["anniversary_calendar"];
							$menu["labelpos"] = "down";
							$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["calendar"]["large"];
							$menu["link"] = "calendar.php";
							$menu["class"] = "menuitem";
							$menu["hoverclass"] = "menuitem_hover";
							$menu["submenuclass"] = "submenu";
							$menu["flyout"] = "down";
							$menu["items"] = array();

							$submenu = array();
							$submenu["label"] = $gm_lang["viewday"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["calendar"]["small"];
							$submenu["link"] = "calendar.php";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;

							$submenu = array();
							$submenu["label"] = $gm_lang["viewmonth"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["calendar"]["small"];
							$submenu["link"] = "calendar.php?action=calendar";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;

							$submenu = array();
							$submenu["label"] = $gm_lang["viewyear"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["calendar"]["small"];
							$submenu["link"] = "calendar.php?action=year";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;

							print_menu($menu);
							print "</td>";
						}

						if (file_exists("reportengine.php")) {
				            print "<td valign=\"top\" width=\"10%\">";
				            $menu = array();
				            $menu["label"] = $gm_lang["reports"];
				            $menu["labelpos"] = "down";
							$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["reports"]["large"];;
				            $menu["link"] = "reportengine.php";
				            $menu["class"] = "menuitem";
				            $menu["hoverclass"] = "menuitem_hover";
				            $menu["submenuclass"] = "submenu";
				            $menu["flyout"] = "down";
				            $menu["items"] = get_reports_submenu("submenuitem$ff", "submenuitem_hover$ff");

				            print_menu($menu);
				            print "</td>";
			            }

			            if (file_exists("clippings.php")) {
							global $ENABLE_CLIPPINGS_CART;
							if ($ENABLE_CLIPPINGS_CART>=getUserAccessLevel()) {
								print "<td valign=\"top\" width=\"10%\">";
								$menu = array();
								$menu["label"] = $gm_lang["clippings_cart"];
								$menu["labelpos"] = "down";
								$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["clippings"]["large"];
								$menu["link"] = "clippings.php";
								$menu["class"] = "menuitem";
								$menu["hoverclass"] = "menuitem_hover";
								print_menu($menu);
								print "</td>";
							}
						}

						if (file_exists("search.php")) {
							print "<td width=\"10%\" valign=\"top\">";
							$menu = array();
							$menu["label"] = $gm_lang["search"];
							$menu["labelpos"] = "down";
							$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["search"]["large"];
							$menu["link"] = "search.php";
							$menu["class"] = "menuitem";
							$menu["hoverclass"] = "menuitem_hover";
							$menu["submenuclass"] = "submenu";
							$menu["flyout"] = "down";
							$menu["items"] = array();

							$submenu = array();
							$submenu["label"] = $gm_lang["search_general"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["search"]["small"];
							$submenu["link"] = "search.php?action=general&amp;topsearch=yes";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;

							$submenu = array();
							$submenu["label"] = $gm_lang["search_soundex"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["search"]["small"];
							$submenu["link"] = "search.php?action=soundex&amp;topsearch=yes";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;

							print_menu($menu);
							print "</td>";
						}

						?>
						<td width="10%" valign="top">
							<?php
							global $SHOW_CONTEXT_HELP, $SCRIPT_NAME, $QUERY_STRING, $helpindex;
							//-- help menu
							$menu = array();
							$menu["label"] = $gm_lang["help_page"];
							$menu["labelpos"] = "down";
							$menu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["help"]["large"];
							$menu["link"] = "#";
							if (empty($helpindex)) $menu["onclick"] = "return helpPopup('help_".basename($SCRIPT_NAME)."&amp;action=".$action."');";
							else $menu["onclick"] = "return helpPopup('".$helpindex."');";
							$menu["class"] = "menuitem";
							$menu["hoverclass"] = "menuitem_hover";
							$menu["flyout"] = "down";
							$menu["submenuclass"] = "submenu";
							$menu["items"] = array();

							$submenu = array();
							$submenu["label"] = $gm_lang["help_for_this_page"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["menu_help"]["small"];
							$submenu["link"] = "#";
							if (empty($helpindex)) $submenu["onclick"] = "return helpPopup('help_".basename($SCRIPT_NAME)."&amp;action=".$action."');";
							else $submenu["onclick"] = "return helpPopup('".$helpindex."');";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;

							$submenu = array();
							$submenu["label"] = $gm_lang["help_contents"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["menu_help"]["small"];
							$submenu["link"] = "#";
							$submenu["onclick"] = "return helpPopup('help_contents_help');";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;
							
							if (file_exists("faq.php")) {
								$submenu = array();
								$submenu["label"] = $gm_lang["faq_list"];
								$submenu["labelpos"] = "right";
								$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["menu_help"]["small"];
								$submenu["link"] = "faq.php";
								$submenu["class"] = "submenuitem$ff";
								$submenu["hoverclass"] = "submenuitem_hover$ff";
								$menu["items"][] = $submenu;
							}
							
						 if (file_exists("searchhelp.php")) {
							$submenu = array();
							$submenu["label"] = $gm_lang["hs_title"];
							$submenu["labelpos"] = "right";
							$submenu["icon"] = $GM_IMAGE_DIR."/".$GM_IMAGES["search"]["small"];
							$submenu["link"] = "#";
    			            $submenu["onclick"] = "window.open('searchhelp.php', '', 'top=50,left=10,width=700,height=600,scrollbars=1,resizable=1');";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;
						 }
							$menu["items"][]="separator";
							//-- add contact links to help menu
			                $menuitems = print_contact_links(1);
			                foreach($menuitems as $menuitem) {
				                $menuitem["class"] = "submenuitem$ff";
			                	$menuitem["hoverclass"] = "submenuitem_hover$ff";
				                $menu["items"][] = $menuitem;
			                }
			                $menu["items"][]="separator";

							$submenu = array();
							if ($_SESSION["show_context_help"]) {
							$submenu["label"] = $gm_lang["hide_contexthelp"];
							$submenu["link"] = "$SCRIPT_NAME?$QUERY_STRING&amp;show_context_help=no";
							}
							else {
							$submenu["label"] = $gm_lang["show_contexthelp"];
							$submenu["link"] = "$SCRIPT_NAME?$QUERY_STRING&amp;show_context_help=yes";
							}
							$submenu["labelpos"] = "right";
							$submenu["class"] = "submenuitem$ff";
							$submenu["hoverclass"] = "submenuitem_hover$ff";
							$menu["items"][] = $submenu;
							print_menu($menu);
							?>
						</td>
						<td width="10">&nbsp;</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-image:url('<?php print $GM_IMAGE_DIR; ?>/sombra.gif'); height:4;">
  <tr>
	  <td><img src="<?php print $GM_IMAGE_DIR; ?>/pixel.gif" width="1" height="1" alt="" /></td>
  </tr>
</table>
<br />
<?php include("accesskeyHeaders.php"); ?>
</div><!-- close div for div id="header" -->
<?php print "<div id=\"content\">\n"; ?>
